package demo.practice.competition;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class P5637 {

    public static void main(String[] args) {
        P5637 p5637= new P5637();
        p5637.halvesAreAlike("book");

    }
    public boolean halvesAreAlike(String s) {
        int len=s.length();
        String befor =s.substring(0,len/2);
        String behind=s.substring(len/2);

        System.out.println(befor);
        System.out.println(behind);

//        int [] y= new int[52];
        List<Character> list= Arrays.asList('a','e','i','o','u','A','E','I','O','U');
        int sum1=0;
        for(int i=0;i<befor.length();i++){
            if(list.contains(befor.charAt(i)))
                sum1++;
        }

        int sum2=0;
        for(int i=0;i<behind.length();i++){
            if(list.contains(behind.charAt(i)))
                sum2++;
        }

        return sum1==sum2;
    }
}
